• gcc -02引起内存溢出'unsigned i'应修订为'volatile unsigned i'


    2017-12-13 10:44:19
    gcc -02引起内存溢出'unsigned i'应修订为'volatile unsigned i'

    1.3.100 driver/char/random.c
    static inline void add_entropy_word(struct random_bucket *r,
                        const __u32 input)
    {
        volatile unsigned i; //old : unsigned i;
        __u32 w;

        w = (input << r->input_rotate) | (input >> (32 - r->input_rotate));
        i = r->add_ptr = (r->add_ptr - 1) & (POOLWORDS-1);
        if (i)
            r->input_rotate = (r->input_rotate + 7) & 31;
        else
            /*
             * At the beginning of the pool, add an extra 7 bits
             * rotation, so that successive passes spread the
             * input bits across the pool evenly.
             */
            r->input_rotate = (r->input_rotate + 14) & 31;

        /* XOR in the various taps */
        w ^= r->pool[(i+TAP1)&(POOLWORDS-1)];
        w ^= r->pool[(i+TAP2)&(POOLWORDS-1)];
        w ^= r->pool[(i+TAP3)&(POOLWORDS-1)];
        w ^= r->pool[(i+TAP4)&(POOLWORDS-1)];
        w ^= r->pool[(i+TAP5)&(POOLWORDS-1)];
        w ^= r->pool[i];
        /* Rotate w left 1 bit (stolen from SHA) and store */
        r->pool[i] = (w << 1) | (w >> 31);
    }

  • 相关阅读:
    touch命令
    cd命令
    通配符
    速查命令
    一些技巧
    从零开始用 Flask 搭建一个网站(四)
    【老板来了你立刻知道!】人脸识别+手机推送
    React Native 一些事
    React-Native 工程添加推送功能 (iOS 篇)
    集成 jpush
  • 原文地址:https://www.cnblogs.com/mull/p/8031748.html
Copyright © 2020-2023  润新知